<?php include_once "controle/controle_empresa.php"; ?>
            <div id="cadastro_empresa">
                <script type="text/javascript" >
                    new uvumiCropper('myImage',{
                        //preview:'myPreview',
                        preview: true,
                        coordinatesOpacity:1,
                        keepRatio:false,
                        handles:[
                            ['top','left'],
                            ['top','right'],
                            ['bottom','left'],
                            ['bottom','right']
                        ],
                        mini:{
                            x:100,
                            y:100
                        },
                        onComplete:function(top,left,width,height){
                            $('input_top').set('value', top);
                            $('input_left').set('value', left);
                            $('input_width').set('value', width);
                            $('input_height').set('value', height);
                        }
                    });

                </script>
                <form action="" method="post" id="form_cadastro" name="form_logo" enctype="multipart/form-data">
                    <h1>Alterar logo</h1>
                    
                    <fieldset>
                        <?php
                        if(!isset($tmp_logo)){
                            if($empresa->get_logo()){
                            ?>

                        <img src="logo/<?=$empresa->get_logo()?>" alt="Logo?>" usemap="#logo_mapa">
                        <br>
                            <?php } ?>
                        <input type="file" name="logo" id="form_logo" value="" onchange="form_submit()">

                        <?php }else{ ?>

                        <input name="logo" type="hidden" value="<?=$tmp_logo?>">
                        <input id="input_top" name="top" type="hidden">
                        <input id="input_left" name="left" type="hidden">
                        <input id="input_width" name="width" type="hidden">
                        <input id="input_height" name="height" type="hidden">

                        <div id="myImageDiv" style="width: <?=$info[0]?>px">
                            <img id="myImage" src="logo/tmp/<?=$tmp_logo?>" alt="Logo">
                        </div>

                        <?php } ?>
                        
                    </fieldset>
                    <?php if(isset($tmp_logo)){ ?>
                    <br>
                    <button type="submit" name="btn_alt_logo" value="Alterar">Alterar</button>
                    <?php } ?>
                </form>
            </div>